<%= render  :partial => "apo/navigation" %>

<div id="containerBody">

  <%= error_messages_for "event" %>

  <% if (@event.mic_id == session[:user].id and @event.event_type != "Indy Hours") or session[:user].admin %>

    <% form_tag :action => "save" , :id => params[:id]  do %>

      <div class="container">

        <div class="cellRow">

          <div class="cellBlock">
            Event Name
          </div>
          <div class="cellBlock">
             <%= text_field "event" , "name", :maxlength => 35 %>
          </div>
          <div class="cellBlock">
            Contact Name
          </div>
          <div class="cellBlock">
            <%=text_field "event" , "contact", :maxlength => 30 %>
          </div>

        </div>

        <div class="cellRow">

          <div class="cellBlock">
            Event Date
          </div>
          <div class="cellBlock">
            <%= datetime_select("event", "date", :default => Time.now, :order => [:month, :day, :year, :hour, :minute]) %>
          </div>
          <div class="cellBlock">
            Contact Phone
          </div>
          <div class="cellBlock">
            <%=text_field "event" , "contact_phone", :maxlength => 10 %>
          </div>

        </div>

        <div class="cellRow">

          <div class="cellBlock">
            Number of Hours
          </div>
          <div class="cellBlock">
            <%=text_field "event" , "hours", :maxlength => 5 %>
          </div>
          <div class="cellBlock">
            Address
          </div>
          <div class="cellBlock">
            <%=text_field "event" , "address", :maxlength => 30 %>
          </div>

        </div>

        <div class="cellRow">

          <div class="cellBlock">
            Member In Charge
          </div>
          <div class="cellBlock">
            <%=select "event" , "mic_id" ,
              Member.find(:all, :order => "last_name, first_name ASC").map {|member| [member.full_name , member.id]},
              {:include_blank => true}
            %>
          </div>
          <div class="cellBlock">
            City
          </div>
          <div class="cellBlock">
            <%=text_field "event" , "city", :maxlength => 30 %>
          </div>

        </div>

        <div class="cellRow">

          <div class="cellBlock">
            Event Type
          </div>
          <div class="cellBlock">
            <%= select "event", "event_type",
              {
                "Service" => "Service",
                "Leadership" => "Leadership",
                "Fellowship" => "Fellowship",
                "Meeting" => "Active Meeting",
                "Fundraiser" => "Fundraiser",
                "Dues (on time)" => "Dues",
                "Dues (late)" => "Dues (late)",
                "Committee" => "Committee",
                "Other" => "Other",
                "Pledge Req" => "Pledge Req",
                "Intramurals" => "Intramurals"
              }.sort,
              {:include_blank => true}
            %>
          </div>
          <div class="cellBlock">
            State
          </div>
          <div class="cellBlock">
            <%=text_field "event" , "state", :maxlength => 2 %>
          </div>

        </div>

        <div class="cellRow">

          <div class="cellBlock">
            Max Attendees
          </div>
          <div class="cellBlock">
            <%=text_field "event" , "max_attendees", :maxlength => 4 %>
          </div>
          <div class="cellBlock">
            Zip Code
          </div>
          <div class="cellBlock">
            <%=text_field "event" , "zip", :maxlength => 10 %>
          </div>

        </div>

        <div class="cellRow">

          <div class="cellBlock">
            Drivers
          </div>
          <div class="cellBlock">
            <%=text_field "event" , "drivers", :maxlength => 4 %>
          </div>

        </div>

      </div>

      <h5>
        Note: The number of drivers is the amount of spots you want
        to reserve for drivers.  It does not add on to max attendees.
        This will save you from doing extremely difficult arithmetic in
        your head ;)
      </h5>

      <div class="container">

        <div class="cellRow">

          <div class="cellBlock">
            Credit Type
          </div>
          <div class="cellBlock">
            Credits
          </div>

        </div>

        <div class="cellRow">

          <div class="cellBlock">
            Service Points
          </div>
          <div class="cellBlock">
            <%=text_field "event" , "additional_service_hours", :maxlength => 5, :default => 0 %>
          </div>

        </div>

        <div class="cellRow">

          <div class="cellBlock">
            Leadership Points
          </div>
          <div class="cellBlock">
            <%=text_field "event" , "additional_leaderships", :maxlength => 5, :default => 0 %>
          </div>

        </div>

        <div class="cellRow">

          <div class="cellBlock">
            Fellowship Points
          </div>
          <div class="cellBlock">
            <%=text_field "event" , "additional_fellowships", :maxlength => 5, :default => 0 %>
          </div>

        </div>

        <div class="cellRow">

          <div class="cellBlock">
            Fundraiser Points
          </div>
          <div class="cellBlock">
            <%=text_field "event" , "additional_fundraisers", :maxlength => 5, :default => 0 %>
          </div>

        </div>

        <div class="cellRow">

          <div class="cellBlock">
            Meeting Points
          </div>
          <div class="cellBlock">
            <%=text_field "event" , "additional_active_meetings", :maxlength => 5, :default => 0 %>
          </div>

        </div>
<!--
        <div class="cellRow">

          <div class="cellBlock">
            Chapter
          </div>
          <div class="cellBlock">
            %= check_box_tag 'c[]', 1, @event.four_c & 1 == 1 %
          </div>

        </div>

        <div class="cellRow">

          <div class="cellBlock">
            Campus
          </div>
          <div class="cellBlock">
            %= check_box_tag 'c[]', 2, @event.four_c & 2 == 2 %
          </div>

        </div>

        <div class="cellRow">

          <div class="cellBlock">
            Community
          </div>
          <div class="cellBlock">
            %= check_box_tag 'c[]', 4, @event.four_c & 4 == 4 %
          </div>

        </div>

        <div class="cellRow">

          <div class="cellBlock">
            Country
          </div>
          <div class="cellBlock">
            %= check_box_tag 'c[]', 8, @event.four_c & 8 == 8 %
          </div>

        </div>-->

      </div>

      <br />

      <div class="container">

        <div class="cellRow">

          <div class="cellBlock">
            Meeting Place
          </div>
          <div class="cellBlock">
            <%=text_field "event" , "meeting_place", :maxlength => 75 %>
          </div>

        </div>

        <div class="cellRow">

          <div class="cellBlock">
            Description
          </div>
          <div class="cellBlock">
            <%=text_area "event" , "description", :size => "100x3", :maxlength => 1200 %>
          </div>

        </div>

      </div>

      <%= submit_tag "Save"%>

    <%end%>

  <% else %>
    <h2> <font color="red"> You do not have permission to view this page. </font> </h2>
    <h3> If you feel that you should have permission, please email internet@apouiuc.com <h3>
  <% end %>

</div>
